package com.example.administrator.myapplication.fragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.administrator.myapplication.R;
import com.example.administrator.myapplication.bus.DNBus;
import com.example.administrator.myapplication.bus.Subscribe;

public class Fragment1 extends Fragment {

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragmetn1,container,false);
    }

    @Subscribe({"1","2"})
    public void test(int i, String s){
        Log.e("xiaoyi"," i : " + i + "    s :  "  +s);
    }

    @Subscribe({"2"})
    public void test2(int i, String s){
        Log.e("xiaoyi"," ii : " + i + "    ssss :  "  +s);
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        DNBus.getInstance().register(this);
    }
}
